<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var stus = [{
            id:101,
            name:'zhangsan',
            gender:'男'
        },{
            id:102,
            name:'zhangsi',
            gender:'男'
        },{
            id:103,
            name:'zhangwu',
            gender:'男'
        },{
            id:104,
            name:'zhangliu',
            gender:'男'
        },{
            id:105,
            name:'zhangqi',
            gender:'男'
        }];
        window.onload = function(){
            var tbody = document.getElementsByTagName('tbody')[0];
            var str = '';
            stus.forEach(function(item,index){
                // item 元素   index 索引  
                console.log(item,index);
                str += `<tr>
                <td>${item.id}</td>
                <td>${item.name}</td>
                <td>${item.gender}</td>
            </tr>`;
            })
            tbody.innerHTML = str;
        }
    </script>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>性别</th>
            </tr>
        </thead>
        <tbody>
            
        </tbody>
    </table>
</body>
</html>